package com.sinosoft.brokerchannel.base.utile;

import com.sinosoft.brokerchannel.base.common.ChannelConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 需求名称：[大童理赔渠道平台]<br/>
 * 类描述:[一句话描述该类的功能]<br/>
 *
 * @author shilk
 * @version V1.0
 * @date 2018-7-28 12:00
 */

public class DictUtils {
    private final static Logger logger = LoggerFactory.getLogger(DictUtils.class);


    /**
     *将字母转换成数字_1 - ABC转123
      */
    public static String char2num(String input) {
        String reg = "[a-zA-Z]";
        StringBuffer strBuf = new StringBuffer();
        input = input.toLowerCase();
        if (null != input && !"".equals(input)) {
            for (char c : input.toCharArray()) {
                if (String.valueOf(c).matches(reg)) {
                    strBuf.append(c - 96);
                } else {
                    strBuf.append(c);
                }
            }
            return strBuf.toString();
        } else {
            return input;
        }
    }
}
